package com.liyi.letter.processing.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.liyi.letter.processing.enums.LetterType;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author Administrator
 * @since 2023-06-16
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "letter", schema = "petition_processing")
public class Letter implements Serializable {

    /**
     * 信访内容表id
     */
    @Id(keyType = KeyType.Auto)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 信访人信息表id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long petitionerId;

    /**
     * 受信对象表id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long respondentId;

    /**
     * 信访类型
     */
    private LetterType type;

    /**
     * 信访主题
     */
    private String subject;

    /**
     * 信访内容
     */
    private String content;

    /**
     * 受理时间
     */
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date receivedTime;

    /**
     * 受理结果
     */
    private String processingResult;

    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date createdTime;

    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date updatedTime;

}
